package com.guoxue.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.guoxue.dao.IPlanProgressDao;
import com.guoxue.domain.PlanProgressVo;
import com.guoxue.service.IPlanProgressService;

@Service("planProgressService")
public class PlanProgressServiceImpl implements IPlanProgressService{

	@Resource
	private IPlanProgressDao dao;

	@Override
	public List<PlanProgressVo> getUserPlans(int id) {
		return dao.getUserPlans(id);
	}

	@Override
	public PlanProgressVo getPlanByUserAndPlanId(int id, int planId) {
		return dao.getPlanByUserAndPlanId(id, planId);
	}

	@Override
	public void savePlan(PlanProgressVo plan) {
		dao.savePlan(plan);
	}

	@Override
	public List<PlanProgressVo> getUserPlansByPlanId(int id, int beginPlanId, int endPlanId) {
		return dao.getUserPlansByPlanId(id,beginPlanId,endPlanId);
	}

	@Override
	public int getReadersCount(int id, int begin, int end) {
		return dao.getReadersCount(id,begin,end);
	}

	@Override
	public PlanProgressVo getUserPlanByUidAndPlanId(int id, int planId) {
		return dao.getUserPlanByUidAndPlanId(id,planId);
	}

	@Override
	public long getCount(int planId) {
		return dao.getCount(planId);
	}

	@Override
	public long getCompleteCount(int currentReadCount,int planId) {
		return dao.getCompleteCount(currentReadCount,planId);
	}

	@Override
	public PlanProgressVo getLastCommit(int id) {
		return dao.getLastCommit(id);
	}
}
